import { Button, Result } from 'antd';
import type { FC, ReactNode } from 'react';
import { memo } from 'react';
import { useNavigate } from 'react-router-dom';
import { HOME_PATH } from '@/router';

interface IProps {
  children?: ReactNode;
}

const NotFound: FC<IProps> = () => {
  const navigate = useNavigate();
  return (
    <Result
      status={'404'}
      title={'404'}
      subTitle={'您访问的页面不存在'}
      extra={
        <Button type="primary" onClick={() => navigate(HOME_PATH)}>
          返回首页
        </Button>
      }
    ></Result>
  );
};

export default memo(NotFound);
